﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGeCurveSurfInt : OdGeEntity3d
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGeCurveSurfInt(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGeCurveSurfInt_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGeCurveSurfInt obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGeCurveSurfInt()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGeCurveSurfInt(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public OdGeCurveSurfInt() : this(GlobalsPINVOKE.new_OdGeCurveSurfInt__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurveSurfInt(OdGeCurve3d curve, OdGeSurface surface, OdGeTol tol) : this(GlobalsPINVOKE.new_OdGeCurveSurfInt__SWIG_1(OdGeCurve3d.getCPtr(curve), OdGeSurface.getCPtr(surface), OdGeTol.getCPtr(tol)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurveSurfInt(OdGeCurve3d curve, OdGeSurface surface) : this(GlobalsPINVOKE.new_OdGeCurveSurfInt__SWIG_2(OdGeCurve3d.getCPtr(curve), OdGeSurface.getCPtr(surface)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurveSurfInt(OdGeCurveSurfInt source) : this(GlobalsPINVOKE.new_OdGeCurveSurfInt__SWIG_3(OdGeCurveSurfInt.getCPtr(source)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurve3d curve()
		{
			OdGeCurve3d result = new OdGeCurve3d(GlobalsPINVOKE.OdGeCurveSurfInt_curve(this.swigCPtr), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeSurface surface()
		{
			IntPtr intPtr = GlobalsPINVOKE.OdGeCurveSurfInt_surface(this.swigCPtr);
			OdGeSurface result = (intPtr == IntPtr.Zero) ? null : new OdGeSurface(intPtr, false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeTol tolerance()
		{
			OdGeTol result = new OdGeTol(GlobalsPINVOKE.OdGeCurveSurfInt_tolerance(this.swigCPtr), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public int numIntPoints(ref OdGe.OdGeIntersectError status)
		{
			int result = GlobalsPINVOKE.OdGeCurveSurfInt_numIntPoints(this.swigCPtr, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGePoint3d intPoint(int intNum, ref OdGe.OdGeIntersectError status)
		{
			OdGePoint3d result = new OdGePoint3d(GlobalsPINVOKE.OdGeCurveSurfInt_intPoint(this.swigCPtr, intNum, ref status), true);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void getIntParams(int intNum, out double param1, OdGePoint2d param2, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeCurveSurfInt_getIntParams(this.swigCPtr, intNum, out param1, OdGePoint2d.getCPtr(param2), ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getPointOnCurve(int intNum, OdGePointOnCurve3d intPnt, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeCurveSurfInt_getPointOnCurve(this.swigCPtr, intNum, OdGePointOnCurve3d.getCPtr(intPnt), ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getPointOnSurface(int intNum, OdGePointOnSurface intPnt, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeCurveSurfInt_getPointOnSurface(this.swigCPtr, intNum, OdGePointOnSurface.getCPtr(intPnt), ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void getIntConfigs(int intNum, ref OdGe.csiConfig lower, ref OdGe.csiConfig higher, out bool smallAngle, ref OdGe.OdGeIntersectError status)
		{
			GlobalsPINVOKE.OdGeCurveSurfInt_getIntConfigs(this.swigCPtr, intNum, ref lower, ref higher, out smallAngle, ref status);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGeCurveSurfInt set(OdGeCurve3d cvr, OdGeSurface surface, OdGeTol tol)
		{
			OdGeCurveSurfInt result = new OdGeCurveSurfInt(GlobalsPINVOKE.OdGeCurveSurfInt_set__SWIG_0(this.swigCPtr, OdGeCurve3d.getCPtr(cvr), OdGeSurface.getCPtr(surface), OdGeTol.getCPtr(tol)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCurveSurfInt set(OdGeCurve3d cvr, OdGeSurface surface)
		{
			OdGeCurveSurfInt result = new OdGeCurveSurfInt(GlobalsPINVOKE.OdGeCurveSurfInt_set__SWIG_1(this.swigCPtr, OdGeCurve3d.getCPtr(cvr), OdGeSurface.getCPtr(surface)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGeCurveSurfInt Assign(OdGeCurveSurfInt crvSurfInt)
		{
			OdGeCurveSurfInt result = new OdGeCurveSurfInt(GlobalsPINVOKE.OdGeCurveSurfInt_Assign(this.swigCPtr, OdGeCurveSurfInt.getCPtr(crvSurfInt)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
